package cn.terminus.client.customer.contractinfo.service;

import cn.terminus.client.customer.analysis.param.AnalysisYearParam;
import cn.terminus.client.customer.contractinfo.param.*;
import cn.terminus.client.customer.contractinfo.result.ContractInfoResult;
import cn.terminus.client.customer.contractinfo.result.RentContractInfoDetailResult;
import cn.terminus.client.customer.contractinfo.result.SellContractInfoDetailResult;
import cn.terminus.client.customer.custompurposeroom.result.CustomPurposeRoomResult;
import cn.terminus.result.common.context.TerminusCallContext;
import cn.terminus.result.common.exception.DataAccessException;
import cn.terminus.result.common.exception.ServiceException;
import cn.terminus.result.common.page.TerminusPageAble;
import cn.terminus.result.common.page.TerminusPageInfo;
import cn.terminus.result.common.result.TerminusResult;

import java.util.List;

/**
 * 合同信息表(ContractInfo)表服务接口
 *
 * @author makejava
 * @since 2021-07-21 11:01:06
 */
public interface ContractInfoService {

    /**
     * 更新
     *
     * @param param
     * @param context
     * @return
     * @throws ServiceException
     */
    TerminusResult<Boolean> update(ContractInfoEditParam param, TerminusCallContext context) throws ServiceException;


    /**
     * gets
     *
     * @param param
     * @param context
     * @return
     * @throws ServiceException
     */
    TerminusResult<List<ContractInfoResult>> gets(ContractInfoGetsParam param, TerminusCallContext context) throws ServiceException;

    /**
     * 删除
     *
     * @param param
     * @param context
     * @return
     * @throws ServiceException
     */
    TerminusResult<Boolean> delete(ContractInfoDeleteParam param, TerminusCallContext context) throws ServiceException;

    /**
     * 查询
     *
     * @param param
     * @param context
     * @return
     * @throws ServiceException
     */
    TerminusResult<List<ContractInfoResult>> query(ContractInfoQueryParam param, TerminusCallContext context) throws ServiceException;

    /**
     * 分页查询
     *
     * @param param
     * @param page
     * @param context
     * @return
     * @throws ServiceException
     */
    TerminusResult<TerminusPageAble<ContractInfoResult>> page(ContractInfoQueryParam param, TerminusPageInfo page, TerminusCallContext context) throws ServiceException, DataAccessException;

    /**
     * 新加租赁合同
     *
     * @param param
     * @param terminusContext
     * @return
     */
    TerminusResult<String> addRentContract(RentContractNewParam param, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<String> addSellContract(SellContractNewParam param, TerminusCallContext terminusContext) throws ServiceException;


    TerminusResult<String> getCode(Integer type, TerminusCallContext terminusContext);

    TerminusResult<SellContractInfoDetailResult> querySellById(Long id, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<RentContractInfoDetailResult> queryRentById(Long id, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<Boolean> editRentContract(RentContractNewParam param, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<Boolean> editSellContract(SellContractNewParam param, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<Boolean> deleteByIds(ContractInfoDeleteParam param, TerminusCallContext terminusContext) throws ServiceException;


    TerminusResult<List<CustomPurposeRoomResult>> geturposeRoomInfoByContractIds(List<Long> contractIdList) throws ServiceException;

    TerminusResult<Boolean> queryRoomsWithContract(List<Long> ids, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<Integer> analysisTotalContract(AnalysisYearParam year, TerminusCallContext terminusContext) throws ServiceException;

    TerminusResult<Boolean> getContractRoomsInfo(ContractRoomsInfoQueryParam param, TerminusCallContext terminusContext) throws ServiceException;
}
